<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./js/jquery.min.js"></script>
    <script>
        // $.ajax({
        //     type: "GET",
        //     url: "http://localhost/project/server/check.php",
        //     success: function (msg) {
        //         alert("Data Saved: " + msg);
        //     }
        // });
        // $.ajax({
        //     type: "POST",
        //     url: "http://localhost/project/server/check.php",
        //     success: function (msg) {
        //         alert("Data Saved: " + msg);
        //     }
        // });

        function callbackFunction(data){
            console.log(data);
        }
        /* 一级封装可以解决跨域的问题 */
        $.ajax({
            dataType:"jsonp",
            type: "POST",
            url: "https://www.runoob.com/try/ajax/jsonp.php?jsoncallback=callbackFunction",
            success: function (msg) {
                alert("Data Saved: " + msg);
            }
        });
    </script>
</body>

</html>